package voovanHello;

import org.voovan.network.aio.AioServerSocket;

import java.io.IOException;

/**
 * 我有故事，你有酒么？
 * JKhaled created by yunqisong@foxmail.com 2017/8/31
 * FOR :
 */
public class VServer {

    public VServer() {
        try {
            AioServerSocket serverSocket = new VAioServerSocket("127.0.0.1", 20131, Integer.MAX_VALUE);
            serverSocket.messageSplitter(new VMessageSplitter()); // 粘包器
            serverSocket.filterChain().add(new VStringFilter()); // 使用StringFilter把byte转化成为String
            serverSocket.handler(new VServerHandler());         // 业务处理句柄
            serverSocket.start();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main (String[] args){
        new VServer();
    }
}
